home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Utilities / AmiMirror / Developer / prefs / source / AmiMirrorPrefs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-06-30  |  21.4 KB  |  816 lines

  1. #include <exec/types.h> 
  2.  
  3. // Data transfers between custom methods
  4. typedef struct
  5.   {
  6.     ULONG MethodID;
  7.     ULONG ID1;
  8.     ULONG ID2;
  9.     ULONG ID3;
  10.   } Tie;
  11.  
  12. // Nice new type - who say no ?! :)
  13. typedef union
  14.   {
  15.     ULONG  num;
  16.     STRPTR str;
  17.   } VAGUE;
  18.  
  19. ///                              ­¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¯                         <
  20. ///
  21. ///”””””””””””””””””””””””””””””ƒ   More includes  ”””””””””””””””””””””””” <
  22. ///
  23. ///                              ¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡´                         <
  24. ///
  25. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  26. ///
  27. ///                              exec.library                                 <
  28. ///
  29. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  30. ///
  31. #include <clib/exec_protos.h>
  32. #include <pragmas/exec_sysbase_pragmas.h>
  33. #include <exec/ports.h>
  34. #include <exec/nodes.h>
  35. #include <exec/alerts.h>
  36. #include <exec/memory.h>
  37. #include <exec/execbase.h>
  38.  
  39. IMPORT struct ExecBase *SysBase;  // Always opened
  40. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  41. ///
  42. ///                        File management - dos.library                      <
  43. ///
  44. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  45. ///
  46. #include <dos.h>
  47. #include <clib/dos_protos.h>
  48. #include <pragmas/dos_pragmas.h>
  49.  
  50. IMPORT struct Library *DOSBase;   // Opened with compiler link code
  51. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  52. ///
  53. ///                            intuition.library                              <
  54. ///
  55. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  56. ///
  57. #include <clib/intuition_protos.h>
  58. #include <pragmas/intuition_pragmas.h>
  59.  
  60. #define INTUITION_LIBRARY_NAME    "intuition.library"
  61. #define INTUITION_LIBRARY_VERSION 36L
  62.  
  63. STATIC struct Library *IntuitionBase = NULL;
  64. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  65. ///
  66. ///          BIG thanks to Stefan Stuntz for muimaster.library                <
  67. ///
  68. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  69. ///
  70. #include <libraries/mui.h>
  71. #include <clib/muimaster_protos.h>
  72. #include <pragmas/muimaster_pragmas.h>
  73. #include <mui/busy_mcc.h>
  74.  
  75. #define MUI_LIBRARY_NAME          MUIMASTER_NAME
  76. #define MUI_LIBRARY_VERSION       MUIMASTER_VLATEST
  77.  
  78. STATIC struct Library *MUIMasterBase = NULL;
  79. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  80. ///
  81. ///                   Localization support - locale.library                   <
  82. ///
  83. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  84. ///
  85. #include <libraries/locale.h>
  86. #include <clib/locale_protos.h>
  87. #include <pragmas/locale_pragmas.h>
  88.  
  89. #define LOCALE_LIBRARY_NAME       "locale.library"
  90. #define LOCALE_LIBRARY_VERSION    38L
  91. #define CATALOG_LAST_VERSION      2
  92.  
  93. STATIC struct Library *LocaleBase = NULL;
  94. STATIC struct Catalog *catalog    = NULL;
  95. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  96. ///
  97. ///                       Requesters - reqtools.library                       <
  98. ///
  99. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  100. ///
  101. #include <libraries/reqtools.h>
  102. #include <clib/reqtools_protos.h>
  103. #include <pragmas/reqtools_pragmas.h>
  104.  
  105. #define REQ_LIBRARY_NAME REQTOOLSNAME
  106. #define REQ_LIBRARY_VERSION REQTOOLSVERSION
  107.  
  108. STATIC struct Library *ReqToolsBase;
  109. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  110. ///
  111. ///                            xpkmaster.library                              <
  112. ///
  113. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  114. ///
  115. #include <pragma/xpkmaster_lib.h>
  116.  
  117. #define XPK_LIBRARY_NAME    "xpkmaster.library"
  118. #define XPK_LIBRARY_VERSION 4L
  119.  
  120. STATIC struct Library *XpkBase = NULL;
  121. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  122. ///
  123. ///                             identify.library                              <
  124. ///
  125. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  126. ///
  127. #include <libraries/identify.h>
  128. #include <clib/identify_protos.h>
  129. #include <pragmas/identify_pragmas.h>
  130.  
  131. #define ID_LIBRARY_NAME     "identify.library"
  132. #define ID_LIBRARY_VERSION  IDENTIFYVERSION
  133.  
  134. STATIC struct Library *IdentifyBase = NULL;
  135. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  136. ///
  137. ///                            and some other...                              <
  138. ///
  139. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  140. ///
  141. #include <ctype.h>
  142. #include <error.h>
  143. #include <stdio.h>
  144. #include <stdlib.h>
  145. #include <string.h>
  146. #include <unistd.h>
  147. #include <clib/alib_protos.h>
  148. #include <libraries/gadtools.h>
  149.  
  150. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  151. ///
  152. // Tags of used structures:
  153.  
  154. // data of main window custom class
  155. struct MWData
  156.   {
  157.     Object *PatLView;
  158.     Object *PatList;
  159.     Object *Page;
  160.     Object *Editor;
  161.     Object *Pattern;
  162.     Object *Storage;
  163.     Object *Function;
  164.     Object *PatMode;
  165.     Object *StoMode;
  166.     Object *StoMethod;
  167.     Object *PCheck;
  168.     Object *XpkUse;
  169.     Object *XpkName;
  170.     struct PatternNode *PNode;
  171.     UWORD step;
  172.     UBYTE xpkname[6];
  173.     UBYTE password[32];
  174.     UBYTE CurDir[FMSIZE];
  175.     UBYTE CurFile[FMSIZE];
  176.     UBYTE setsfile[FMSIZE];
  177.   };
  178.  
  179. // data of xpk window custom class
  180. struct XWData
  181.   {
  182.     Object *XpkLView;
  183.     Object *XpkList;
  184.     Object *XpkFName;
  185.     Object *XpkDesc;
  186.     Object *XpkEncrypt;
  187.     Object *XpkStep;
  188.     Object *XpkArrow;
  189.     Object *XpkPSpeed;
  190.     Object *XpkUPSpeed;
  191.     Object *XpkRatio;
  192.     Object *XpkComment;
  193.     Object *XpkPassword;
  194.     UBYTE pspeed[32];
  195.     UBYTE upspeed[32];
  196.     UBYTE ratio[32];
  197.   };
  198.  
  199. // header of settings file
  200. struct SetsHeader
  201. {
  202.   ULONG sh_ID;
  203.   ULONG sh_version;
  204.   ULONG sh_amount;
  205. };
  206.  
  207. // header of pattern is settings file
  208. struct PatternHeader
  209. {
  210.   unsigned ph_PatternMode   : 2;
  211.   unsigned ph_StorageMode   : 2;
  212.   unsigned ph_StorageMethod : 2;
  213.   unsigned ph_PerformCheck  : 1;
  214.   unsigned ph_UseXPK        : 1;
  215.   unsigned ph_Function      : 2;
  216.   unsigned ph_pad           : 6;
  217.   UBYTE    ph_XPKName[6];
  218.   UWORD    ph_XPKMode;
  219.   UWORD    ph_PatternSize;
  220.   UWORD    ph_StorageSize;
  221.   UWORD    ph_PasswordSize;
  222. };
  223.  
  224. // work pattern's node
  225. struct PatternNode
  226. {
  227.   struct Node pn_Node;
  228.   unsigned pn_PatternMode   : 2;
  229.   unsigned pn_StorageMode   : 2;
  230.   unsigned pn_StorageMethod : 2;
  231.   unsigned pn_PerformCheck  : 1;
  232.   unsigned pn_UseXPK        : 1;
  233.   unsigned pn_Function      : 2;
  234.   unsigned pn_pad           : 6;
  235.   UBYTE    pn_XPKName[6];
  236.   UWORD    pn_XPKMode;
  237.   UBYTE    pn_Pattern[FMSIZE];
  238.   UBYTE    pn_Storage[FMSIZE];
  239.   UBYTE    pn_Password[32];
  240. };
  241.  
  242. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  243. ///
  244. // Some macros:
  245.  
  246. #define REG(x)           register __ ## x
  247. #define GETMES(x)        (messages[x])
  248. #define GETKEY(x)        ((UBYTE)(*(GETMES(x))))
  249. #define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
  250. #define PicPic(w,h,b,z)  BodychunkObject,            TextFrame,\
  251.                          MUIA_InnerBottom,           0L,\
  252.                          MUIA_InnerLeft,             0L,\
  253.                          MUIA_InnerRight,            0L,\
  254.                          MUIA_InnerTop,              0L,\
  255.                          MUIA_FixWidth,              w,\
  256.                          MUIA_FixHeight,             h,\
  257.                          MUIA_Bitmap_Width,          w,\
  258.                          MUIA_Bitmap_Height,         h,\
  259.                          MUIA_Bodychunk_Depth,       PIC_P,\
  260.                          MUIA_Bodychunk_Body,        b,\
  261.                          MUIA_Bodychunk_Compression, z,\
  262.                          MUIA_Bodychunk_Masking,     FALSE,\
  263.                          MUIA_Bitmap_SourceColors,   (UBYTE *)colors,\
  264.                          End    
  265. #define FrmPic(w,h,b,z)  BodychunkObject,            ButtonFrame,\
  266.                          MUIA_InnerBottom,           0L,\
  267.                          MUIA_InnerLeft,             0L,\
  268.                          MUIA_InnerRight,            0L,\
  269.                          MUIA_InnerTop,              0L,\
  270.                          MUIA_FixWidth,              w,\
  271.                          MUIA_FixHeight,             h,\
  272.                          MUIA_Bitmap_Width,          w,\
  273.                          MUIA_Bitmap_Height,         h,\
  274.                          MUIA_Bodychunk_Depth,       PIC_P,\
  275.                          MUIA_Bodychunk_Body,        b,\
  276.                          MUIA_Bodychunk_Compression, z,\
  277.                          MUIA_Bodychunk_Masking,     FALSE,\
  278.                          MUIA_Bitmap_SourceColors,   (UBYTE *)colors,\
  279.                          End    
  280. #define ButPic(w,h,b,z)  BodychunkObject,            NoFrame,\
  281.                          MUIA_InnerBottom,           0L,\
  282.                          MUIA_InnerLeft,             0L,\
  283.                          MUIA_InnerRight,            0L,\
  284.                          MUIA_InnerTop,              0L,\
  285.                          MUIA_FixWidth,              w,\
  286.                          MUIA_FixHeight,             h,\
  287.                          MUIA_Bitmap_Width,          w,\
  288.                          MUIA_Bitmap_Height,         h,\
  289.                          MUIA_Bitmap_Transparent,    0L,\
  290.                          MUIA_Bodychunk_Depth,       PIC_P,\
  291.                          MUIA_Bodychunk_Body,        b,\
  292.                          MUIA_Bodychunk_Compression, z,\
  293.                          MUIA_Bodychunk_Masking,     FALSE,\
  294.                          MUIA_Bitmap_SourceColors,   (UBYTE *)colors,\
  295.                          End    
  296. #define Text(text)       TextObject,\
  297.                          MUIA_Text_Contents, text,\
  298.                          End
  299. #define SText(text)      TextObject,\
  300.                          TextFrame,\
  301.                          MUIA_Text_Contents, text,\
  302.                          End
  303. #define CText(text)      TextObject,\
  304.                          MUIA_Text_Contents, text,\
  305.                          MUIA_Text_PreParse, MUIX_C,\
  306.                          End
  307. #define CHText(text)     TextObject,\
  308.                          MUIA_Text_Contents, text,\
  309.                          MUIA_Text_PreParse, MUIX_PH MUIX_C,\
  310.                          End
  311. #define CBText(text)     TextObject,\
  312.                          MUIA_Text_Contents, text,\
  313.                          MUIA_Text_PreParse, MUIX_B MUIX_C,\
  314.                          End
  315.  
  316. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  317. ///
  318. // Some other defines:
  319.  
  320. // custom methods
  321. #define MYTAGBASE (TAG_USER | ( 1 << 16))
  322. // ...main window custom class...
  323. #define MUIM_MW_Open                   (MYTAGBASE | 0x1100)
  324. #define MUIM_MW_Close                  (MYTAGBASE | 0x1101)
  325. #define MUIM_MW_XpkUse                 (MYTAGBASE | 0x1102)
  326. #define MUIM_MW_XpkOpen                (MYTAGBASE | 0x1103)
  327. #define MUIM_MW_XpkClose               (MYTAGBASE | 0x1104)
  328. #define MUIM_MW_ListSelect             (MYTAGBASE | 0x1105)
  329. #define MUIM_MW_NewPattern             (MYTAGBASE | 0x1106)
  330. #define MUIM_MW_DelPattern             (MYTAGBASE | 0x1107)
  331. #define MUIM_MW_Accept                 (MYTAGBASE | 0x1108)
  332. #define MUIM_MW_ListEx                 (MYTAGBASE | 0x1109)
  333. #define MUIM_MW_Page                   (MYTAGBASE | 0x110A)
  334. #define MUIM_MW_MenuOpen               (MYTAGBASE | 0x110B)
  335. #define MUIM_MW_MenuSave               (MYTAGBASE | 0x110C)
  336. #define MUIM_MW_NewEnv                 (MYTAGBASE | 0x110D)
  337. #define MUIM_MW_PatReq                 (MYTAGBASE | 0x110E)
  338. #define MUIM_MW_StoReq                 (MYTAGBASE | 0x110F)
  339. // ...xpk window custom class...
  340. #define MUIM_XW_Open                   (MYTAGBASE | 0x1200)
  341. #define MUIM_XW_Close                  (MYTAGBASE | 0x1201)
  342. #define MUIM_XW_ListSelect             (MYTAGBASE | 0x1202)
  343. #define MUIM_XW_Step                   (MYTAGBASE | 0x1203)
  344. #define MUIM_XW_Arrow                  (MYTAGBASE | 0x1204)
  345.  
  346. // other
  347. #define SETS_VERSION                   2L
  348. #define SETS_ID                        MAKE_ID('A','M','I','R')
  349.  
  350. #define ALL_RIGHT                      TRUE
  351. #define GAME_OVER                      FALSE
  352.  
  353. #define MSG_MAXSIZE                    256
  354. #define MUI_TEXTCENTER_FMT             MUIX_C "%s"
  355.  
  356. #define DEF_SYS_DIR                    "SYS:"
  357. #define DEF_SETS_FILE                  "amimirror.sets"
  358. #define DEF_ENV_DIR                    "ENV:"
  359. #define DEF_ENVARC_DIR                 "ENVARC:"
  360. #define DEF_ENV_FILE                   "ENV:amimirror.sets"
  361. #define DEF_ENVARC_FILE                "ENVARC:amimirror.sets"
  362. #define TASK_PREFS_NAME                "AMIMIRRORPREFS"
  363. #define COM_PORT_NAME                  "AMIMIRROR_PORT"
  364. #define REPLY_PORT_NAME                "AMIMIRRORPREFS_PORT"
  365.  
  366. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  367. ///
  368. // Named numeric constants:
  369.  
  370. // pages of main window
  371. enum
  372. {
  373.   ABOUT_PROG_PAGE,
  374.   ABOUT_SYSTEM_PAGE,
  375.   EDITOR_PAGE
  376. };
  377.  
  378. // save settings modes
  379. enum
  380. {
  381.   SAVE_SETS_DEF,
  382.   SAVE_SETS_CUR,
  383.   SAVE_SETS_REQ
  384. };
  385.  
  386. // catalog's messages
  387. enum
  388. {
  389.   PROG_NAME,
  390.   PROG_VERSION,
  391.   CATALOG_NAME,
  392.   BUILTIN_LANGUAGE,
  393.  
  394.   PROG_COPYRIGHT,
  395.   PROG_AUTHOR,
  396.   PROG_DESC,
  397.   PROG_INFO_TITLE,
  398.   PROG_COPYLEFT,
  399.   MUI_COPYRIGHT,
  400.  
  401.   REQ_TITLE_ERROR,
  402.  
  403.   OUT_MEM,
  404.   LIBRARY_PROBLEM,
  405.   CC_PROBLEM,
  406.   APPLICATION_PROBLEM,
  407.   WINDOW_PROBLEM,
  408.   CANT_CREATE_PORT,
  409.   NO_COMMODITY,
  410.   DOS_ERROR_STR,
  411.   CANT_OPEN_SETS,
  412.   CANT_READ_SETS,
  413.   CANT_SAVE_SETS,
  414.   CANT_GIVE_SETS,
  415.   LIST_EMPTY_SETS,
  416.   NOT_SETS_FILE,
  417.   XPK_NOLIST_ERROR,
  418.   XPK_NOINFO_ERROR,
  419.   EMPTY_1_ERROR,
  420.   PAT_STORAGE_ERROR,
  421.  
  422.   REQ_SELECT_OPEN_FILE,
  423.   REQ_LOAD_BUT,
  424.   REQ_SELECT_SAVE_FILE,
  425.   REQ_SAVE_BUT,
  426.   REQ_SELECT_PATTERN,
  427.   REQ_SELECT_STORAGE,
  428.   REQ_ACCEPT_BUT,
  429.  
  430.   SAVE_BUT,
  431.   SAVE_KEY,
  432.   USE_BUT,
  433.   USE_KEY,
  434.   EXIT_BUT,
  435.   EXIT_KEY,
  436.   OK_BUT,
  437.   CANCEL_CONTINUE_BUT,
  438.  
  439.   PROJECT_MENU,
  440.   OPEN_MENU,
  441.   OPEN_MENU_KEY,
  442.   LOAD_DEF_MENU,
  443.   LOAD_DEF_MENU_KEY,
  444.   SAVE_MENU,
  445.   SAVE_MENU_KEY,
  446.   SAVE_DEF_MENU,
  447.   SAVE_DEF_MENU_KEY,
  448.   SAVE_AS_MENU,
  449.   SAVE_AS_MENU_KEY,
  450.   ABOUT_MENU,
  451.   PROGRAM_MENU,
  452.   PROGRAM_MENU_KEY,
  453.   SYSTEM_MENU,
  454.   SYSTEM_MENU_KEY,
  455.   HIDE_MENU,
  456.   HIDE_MENU_KEY,
  457.   QUIT_MENU,
  458.   QUIT_MENU_KEY,
  459.   MUI_MENU,
  460.   MUI_ABOUT_MENU,
  461.   MUI_PREFS_MENU,
  462.  
  463.   MAINWIN_TITLE,
  464.   PATLIST_TITLE,
  465.   ADD_BUT,
  466.   ADD_KEY,
  467.   DEL_BUT,
  468.   DEL_KEY,
  469.   UP_BUT,
  470.   UP_KEY,
  471.   DOWN_BUT,
  472.   DOWN_KEY,
  473.  
  474.   SYSTEM_INFO_TITLE,
  475.   SYSTEM_ISTR,
  476.   CPU_ISTR,
  477.   FPU_ISTR,
  478.   MMU_ISTR,
  479.   OS_ISTR,
  480.   EXEC_ISTR,
  481.   WB_ISTR,
  482.   CHSET_ISTR,
  483.   GFX_ISTR,
  484.   CHIP_ISTR,
  485.   FAST_ISTR,
  486.  
  487.   EDITOR_TITLE,
  488.   PATTERN_STR_STR,
  489.   PATTERN_STR_KEY,
  490.   PATTERN_MODE_STR,
  491.   PATTERN_MODE_KEY,
  492.   FILE_PATTERN,
  493.   PATH_PATTERN,
  494.   UNI_PATTERN,
  495.   STORAGE_STR_STR,
  496.   STORAGE_STR_KEY,
  497.   STORAGE_MODE_STR,
  498.   STORAGE_MODE_KEY,
  499.   SIMPLE_FILE,
  500.   FILE_WITH_PATH,
  501.   STORAGE_METHOD_STR,
  502.   STORAGE_METHOD_KEY,
  503.   REPLACE_METHOD,
  504.   COLLECT_METHOD,
  505.   USE_XPK_STR,
  506.   USE_XPK_KEY,
  507.   PERFORM_CHECK_STR,
  508.   PERFORM_CHECK_KEY,
  509.   PERFORM_CHECK_NO,
  510.   PERFORM_CHECK_YES,
  511.   ACCEPT_BUT,
  512.   ACCEPT_KEY,
  513.   CANCEL_BUT,
  514.   CANCEL_KEY,
  515.  
  516.   XPKWIN_TITLE,
  517.   XPKLIST_TITLE,
  518.   XPKINFO_TITLE,
  519.   XPKSET_TITLE,
  520.   NEW_PATTERN_NAME,
  521.   XPK_FULLNAME_STR,
  522.   XPK_DESC_STR,
  523.   ENCRYPT_STR,
  524.   ENCRYPT_ABSENT,
  525.   ENCRYPT_PRESENT,
  526.   ENCRYPT_PASSWORD,
  527.   PACKSPEED_STR,
  528.   UNPACKSPEED_STR,
  529.   XPK_SPEED_FORMAT,
  530.   RATIO_STR,
  531.   XPK_RATIO_FORMAT,
  532.   COMMENT_STR,
  533.   STEP_STR,
  534.   STEP_KEY,
  535.   PASSWORD_STR,
  536.   PASSWORD_KEY,
  537.  
  538.   VERSION_STR,
  539.   WELCOME_STR,
  540.   SOFT_CREATED_STR,
  541.   HEADQUARTERS_STR,
  542.   SNAPMAIL_ADDRESS,
  543.   NET_ADDRESS,
  544.   ATO_STR,
  545.   LANGUAGE_STR,
  546.   TRANSLATION_STR,
  547.   TRANSLATORS_STR,
  548.   WORK_BUT,
  549.   WORK_KEY,
  550.   PROGRAM_BUT,
  551.   PROGRAM_KEY,
  552.   SYSTEM_BUT,
  553.   SYSTEM_KEY,
  554.   FUNCTION_STR,
  555.   FUNCTION_KEY,
  556.   SPARING_STR,
  557.   BACKUP_STR,
  558.   ANTIDEL_STR,
  559.   WRONG_DISKTYPE1_FORMAT,
  560.   WRONG_DISKTYPE2_FORMAT,
  561.   WRONG_DISKTYPE3_FORMAT,
  562.   DEVICE_STR,
  563.   ASSIGN_STR,
  564.  
  565.   FINISH,
  566. };
  567.  
  568.  
  569. ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
  570. ///
  571. // Global data:
  572.  
  573. // catalog's strings
  574. STATIC STRPTR messages[] =
  575. {
  576.   "AmiMirrorPrefs",
  577.   "$VER: AmiMirrorPrefs 2.0 (19.05.99)",
  578.   "amimirrorprefs.catalog",
  579.   "english",
  580.   "AmiMirrorPrefs © 1998-99 Black Square Software",
  581.   "Sergeev O.V",
  582.   "Preferences editor for AmiMirror",
  583.   "Program Information",
  584.   "(c)1998-99 All Bugs Received",
  585.   "This application uses MUI.\nMUI is copyrighted by Stefan Stuntz",
  586.  
  587.   "AmiMirrorPrefs error",
  588.  
  589.   "Not enough memory",
  590.   "Cannot open %s version %ld+",
  591.   "Cannot create MUI custom class",
  592.   "Cannot run MUI application",
  593.   "Cannot create application window",
  594.   "Cannot create port",
  595.   "AmiMirror commodity is not running",
  596.   "\nDOS Error",
  597.   "Cannot open settings file\n%s%s",
  598.   "Cannot read settings file\n%s%s",
  599.   "Cannot save settings file\n%s%s",
  600.   "Cannot trace patterns list properly",
  601.   "Nothing to save.\nPatterns list is empty.",
  602.   "Wrong settings file\n%s",
  603.   "Cannot get list of XPK packers",
  604.   "Cannot get information\nabout XPK packer %s",
  605.   "",
  606.   "Please define both\nPattern and Storage strings!",
  607.  
  608.   "Select file to open",
  609.   "_Open",
  610.   "Select file to save",
  611.   "_Save",
  612.   "Select pattern",
  613.   "Select storage",
  614.   "_Accept",
  615.  
  616.   "Save",
  617.   "s",
  618.   "Use",
  619.   "u",
  620.   "Quit",
  621.   "q",
  622.   "Ok",
  623.   "Cancel|Continue",
  624.  
  625.   "Project",
  626.   "Open...",
  627.   "O",
  628.   "Open default",
  629.   "E",
  630.   "Save",
  631.   "S",
  632.   "Save default",
  633.   "V",
  634.   "Save as...",
  635.   "A",
  636.   "About",
  637.   "Program",
  638.   "P",
  639.   "System",
  640.   "Y",
  641.   "Iconify",
  642.   "I",
  643.   "Quit",
  644.   "Q",
  645.   "MUI",
  646.   "About",
  647.   "Prefs",
  648.  
  649.   "AmiMirrorPrefs - Main Window",
  650.   "Patterns list",
  651.   "Add",
  652.   "a",
  653.   "Delete",
  654.   "d",
  655.   "Up",
  656.   "p",
  657.   "Down",
  658.   "w",
  659.  
  660.   "System Information",
  661.   "System:",
  662.   "CPU:",
  663.   "FPU:",
  664.   "MMU:",
  665.   "Kickstart:",
  666.   "Exec library:",
  667.   "Workbench:",
  668.   "Chipset:",
  669.   "Gfx system:",
  670.   "Chip RAM:",
  671.   "Fast RAM:",
  672.  
  673.   "Editor",
  674.   "Pattern:",
  675.   "t",
  676.   "Pattern Mode:",
  677.   "m",
  678.   "Name",
  679.   "Path",
  680.   "Name & Path",
  681.   "Storage:",
  682.   "g",
  683.   "Storage Mode:",
  684.   "o",
  685.   "Simple File",
  686.   "With Path",
  687.   "Storage Method:",
  688.   "h",
  689.   "Replace",
  690.   "Collect",
  691.   "Use XPK:",
  692.   "x",
  693.   "Perform check:",
  694.   "r",
  695.   "No",
  696.   "Yes",
  697.   "Accept",
  698.   "e",
  699.   "Cancel",
  700.   "c",
  701.  
  702.   "AmiMirrorPrefs - XPK Preferences",
  703.   "Available",
  704.   "Information",
  705.   "Settings",
  706.   "< N O N E >",
  707.   "Full Name",
  708.   "Description",
  709.   "Encrypt:",
  710.   "Absent",
  711.   "Present",
  712.   "Need Password",
  713.   "Pack Speed:",
  714.   "Unpack Speed:",
  715.   "%ld Kb/sec",
  716.   "Ratio:",
  717.   "%ld.%ld%%",
  718.   "Comment:",
  719.  
  720.   "Step:",
  721.   "s",
  722.   "Password:",
  723.   "p",
  724.  
  725.   "Version:",
  726.   "Welcome to use another our product!",
  727.   "This software has been created by",
  728.   "Russian Headquarters: http://www.neworder.spb.ru/bss/",
  729.   "RUSSIA\nSaint Petersburg\n198328, p.o.box 16",
  730.   "39:240/100.3@amiganet\n2:5030/221.3@fidonet\nbigblack@neworder.spb.ru",
  731.   "Many thanks to ATO\n(Amiga Translators' Organization)\nfor language support.",
  732.   "Language:",
  733.   "Translation:",
  734.   "Sergeev O.V",
  735.   "Let me work",
  736.   "l",
  737.   "About program",
  738.   "p",
  739.   "About system",
  740.   "s",
  741.   "Function",
  742.   "f",
  743.   "Spare Copy",
  744.   "Backup Copy",
  745.   "Anti Delete",
  746.   "You selected wrong disk name.\n\0338%s\0330 is \033b%s\033n.\nTry to use %s instead.",
  747.   "You selected wrong disk name.\n\0338%s\0330 is \033b%s\033n.\nOnly REAL volume names are possible here!",
  748.   "You selected wrong disk name.\n\0338%s\0330 is not REAL volume name!",
  749.   "Device",
  750.   "Assignment",
  751. };
  752.  
  753. // program menu
  754. STATIC struct NewMenu MainWinMenu[] =
  755.   {
  756. #define KEY (APTR)TRUE
  757.     { NM_TITLE, NULL,        NULL, 0, 0, (APTR)PROJECT_MENU   },
  758.     { NM_ITEM , NULL,        KEY,  0, 0, (APTR)OPEN_MENU      },
  759.     { NM_ITEM,  NULL,        KEY,  0, 0, (APTR)LOAD_DEF_MENU  },
  760.     { NM_ITEM , NULL,        KEY,  0, 0, (APTR)SAVE_MENU      },
  761.     { NM_ITEM,  NULL,        KEY,  0, 0, (APTR)SAVE_DEF_MENU  },
  762.     { NM_ITEM , NULL,        KEY,  0, 0, (APTR)SAVE_AS_MENU   },
  763.     { NM_ITEM,  NM_BARLABEL, NULL, 0, 0, NULL                 },
  764.     { NM_ITEM,  NULL,        NULL, 0, 0, (APTR)ABOUT_MENU     },
  765.     { NM_SUB,   NULL,        KEY,  0, 0, (APTR)PROGRAM_MENU   },
  766.     { NM_SUB,   NULL,        KEY,  0, 0, (APTR)SYSTEM_MENU    },
  767.     { NM_ITEM,  NM_BARLABEL, NULL, 0, 0, NULL                 },
  768.     { NM_ITEM,  NULL,        KEY,  0, 0, (APTR)HIDE_MENU      },
  769.     { NM_ITEM,  NULL,        KEY,  0, 0, (APTR)QUIT_MENU      },
  770.     { NM_TITLE, NULL,        NULL, 0, 0, (APTR)MUI_MENU       },
  771.     { NM_ITEM,  NULL,        NULL, 0, 0, (APTR)MUI_ABOUT_MENU },
  772.     { NM_ITEM,  NULL,        NULL, 0, 0, (APTR)MUI_PREFS_MENU },
  773.     { NM_END,   NULL,        NULL, 0, 0, NULL                 },
  774. #undef KEY
  775.   };
  776.  
  777. // program data and buffers
  778.  
  779. STATIC VAGUE PatternMode[]   = { FILE_PATTERN, PATH_PATTERN, UNI_PATTERN, NULL };
  780. STATIC VAGUE StorageMode[]   = { SIMPLE_FILE, FILE_WITH_PATH, NULL };
  781. STATIC VAGUE StorageMethod[] = { REPLACE_METHOD, COLLECT_METHOD, NULL };
  782. STATIC VAGUE PerformCheck[]  = { PERFORM_CHECK_NO, PERFORM_CHECK_YES, NULL };
  783. STATIC VAGUE FunctionName[]  = { SPARING_STR, BACKUP_STR, ANTIDEL_STR, NULL };
  784.  
  785. STATIC UBYTE  empty[] = "";
  786. STATIC UBYTE  dosfault[2*FAULT_MAX];
  787.  
  788. STATIC struct XpkPackerList *XL       = NULL;
  789. STATIC struct XpkPackerInfo *XI       = NULL;
  790. STATIC struct XpkMode       *XM       = NULL;
  791.  
  792. STATIC struct List *PatList           = NULL;
  793.  
  794. STATIC Object *AmiMirrorPrefs         = NULL;
  795. STATIC Object *MainWin                = NULL;
  796. STATIC Object *XpkWin                 = NULL;
  797.  
  798. STATIC struct MUI_CustomClass *mw_mcc = NULL;
  799. STATIC struct MUI_CustomClass *xw_mcc = NULL;
  800.  
  801. // Data for the refresh MUI windows trashed with reqtools requesters - yep, bad thing :(
  802. struct Hook ReqHook;
  803. struct TagItem hooktags[] = { RT_Window,       NULL,
  804.                               RT_ShareIDCMP,   TRUE,
  805.                               RT_IntuiMsgFunc, NULL,
  806.                               TAG_DONE, 0L };
  807.  
  808. // proto for assembler routine which does some like sprintf() but with RawDoFmt()
  809. void __stdargs RDF (STRPTR buffer, STRPTR format, ULONG arg, ...);
  810.  
  811. // compiler data
  812. IMPORT LONG __stack   = 8192L;
  813. IMPORT LONG __STKNEED = 2048L;
  814.  
  815.  
  816.